﻿using SW_Interface.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace SW_Interface
{
    /// <summary>
    /// RFID 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class K3Service : System.Web.Services.WebService
    {
        [WebMethod(Description = "获取商品信息（全部)【慢】")]
        public ICItemInfo[] GetMaterialMasterList()
        {
            return ICItemInfo.GetAll();
        }

        [WebMethod(Description = "获取商品信息（根据编码)")]
        public ICItemInfo[] GetMaterialMaster(string[] number)
        {
            return number.Select(ICItemInfo.Get).ToArray();
        }

        [WebMethod()]
        public List<Stock> GetStockList()
        {
            return Stock.GetAll();
        }

        [WebMethod]
        public BillListResponse GetBillList(string stocknumber, int billtype, DateTime datebegin, DateTime dateend)
        {
            return BillListResponse.Get(stocknumber, billtype, datebegin, dateend);
        }

        [WebMethod]
        public BillDetailResponse GetBillInfomation(string billno, int billtype)
        {
            return BillDetailResponse.Get(billno, billtype);
        }

        [WebMethod]
        public List<MaterialType> GetMaterialType()
        {
            return MaterialType.GetAll();
        }
    }
}
